package com.atguigu.gmallpublisher.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @className: TestController
 * @author: LinCong
 * @description:
 * @date: 2023/2/18 15:32
 * @version: 1.0
 */

@RestController
@RequestMapping("/test")
public class TestController {
    @RequestMapping("/test1")
    public String test1() {
        System.out.println("aaa");
        return "{\"id\":\"1001\",\"name\":\"zhangsan\"}";
    }

    @RequestMapping("/test2")
    public String test2(@RequestParam("nn") String name, @RequestParam(value = "age", defaultValue = "18") int age) {
        return "success";
    }

    @RequestMapping("/test3")
    public String test3() {
        System.out.println();
        return "index.html";
    }

}
